#!/bin/sh
read -p  "Input Deploy Version:" version
echo "Now Deploy Version:"$version

mvn install -DskipTests=true;
mvn source:jar

cd ./client
mvn deploy:deploy-file -e -Dversion=${version} -DgroupId=com.darcytech.debezium-manager -DartifactId=client -Dpackaging=jar -Dfile=target/client-${version}.jar -Dsources=target/client-${version}-sources.jar -DrepositoryId=nexus-darcy -Durl=http://nexus.darcytech.com/repository/thirdparty -DpomFile=deployPom.xml;

cd ../common
mvn deploy:deploy-file -e -Dversion=${version} -DgroupId=com.darcytech.debezium-manager -DartifactId=common -Dpackaging=jar -Dfile=target/common-${version}.jar -Dsources=target/common-${version}-sources.jar -DrepositoryId=nexus-darcy -Durl=http://nexus.darcytech.com/repository/thirdparty;

cd ../trans
mvn deploy:deploy-file -e -Dversion=${version} -DgroupId=com.darcytech.debezium-manager -DartifactId=trans -Dpackaging=jar -Dfile=target/trans-${version}.jar -Dsources=target/trans-${version}-sources.jar -DrepositoryId=nexus-darcy -Durl=http://nexus.darcytech.com/repository/thirdparty;